package nodes.typeconst;

import java.util.Random;

public class DoubleConstantState implements ConstantStrategy<Double> {

	private ConstantStrategy<Double> const1, const2;
	private Random ran = new Random();
	
	public DoubleConstantState(ConstantStrategy<Double> const1,
			ConstantStrategy<Double> const2) {
		this.const1 = const1;
		this.const2 = const2;
	}

	@Override
	public Double getConstant() {
		if(ran.nextBoolean())
			return const1.getConstant();
		else
			return const2.getConstant();
	}
}
